Suppose you have a nested BlockReference tree, to compute the cumulative transformation that will be applied to the leaf of the tree you need to multiply in cascade the transformation of each BlockReference.
The transformation of a BlockReference is given by the BlockReference.Transformation multiplied by the inverse translation of its Block.BasePoint. The code below demonstrates how to compute the cumulative transformation of a tree of BlockReference. Each node of the tree, meaning each block, contains just another BlockReference except for the leaf which contains the actual entity.